#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>
#include<stdbool.h>

int cmp(void* e1, void* e2)
{
    return *(int*)e1 - *(int*)e2;
}

bool containsDuplicate(int* nums, int numsSize)
{
    qsort(nums, numsSize, sizeof(int), cmp);

    int i = 0;
    for (i = 0; i + 1 < numsSize; i++)
    {
        if (nums[i] == nums[i + 1])
        {
            return true;
        }
    }

    return false;
}

int main()
{
    int nums[] = { 1,1,1,3,3,4,3,2,4,2 };
    int numsSize = sizeof(nums) / sizeof(nums[0]);
    bool ret = containsDuplicate(nums, numsSize);
    if (ret == true)
    {
        printf("true\n");
    }
    else
    {
        printf("false\n");
    }
    return 0;
}